<template>
    <div class="header_container">
        <el-breadcrumb class="head-top hidden-xs-only" separator="/">
            <el-breadcrumb-item :to="{ path: '/manage' }">首页</el-breadcrumb-item>
            <el-breadcrumb-item v-for="(item, index) in $route.meta.title" :key="index">{{item}}</el-breadcrumb-item>
        </el-breadcrumb>
    </div>
</template>

<script>
// import {baseImgPath} from '@/config/env'
import { mapActions, mapState } from "vuex";

export default {
    data() {
        return {
            // baseImgPath,
            footList: [
                {
                    name: "首页",
                    router: "/manage"
                },
                {
                    name: "个人中心",
                    router: "/myPage"
                }
            ]
        };
    },
    props: {
        isShow: {
            type: Boolean,
            default: true
        }
    },
    // created(){
    // 	if (!this.adminInfo.id) {
    // 		this.getAdminData()
    // 	}
    // },
    computed: {
        ...mapState(["adminInfo"]),
        defaultActive: function() {
            return this.$route.path.replace("/", "");
        },
        fileRouter() {
            if (!this.isShow) {
                return false;
            }
            let flag = false;
            let vm = this;
            this.footList.forEach(value => {
                if (this.$route.path == value.router) {
                    flag = true;
                }
            });
            return flag;
        }
    },
    methods: {
        handleSelect(key, keyPath) {
            console.log(key, keyPath);
        },
        ...mapActions(["getAdminData"]),

        goPersonal() {
            this.$router.push({
                path: "personal"
            });
        },
        goback() {
            this.$router.go(-1);
        },
        go(router) {
            if (this.$route.path == router) {
                return;
            }
            this.$router.push({
                path: router
            });
        }
    }
};
</script>

<style lang="less">
@import "../style/mixin";
.header_container {
    background-color: #eff2f7;
    height: 60px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-left: 20px;

    .avator {
        .wh(36px, 36px);
        border-radius: 50%;
        margin-right: 37px;
    }
    .el-dropdown-menu__item {
        text-align: center;
    }
    .el-menu-demo {
        display: none;
    }

}
</style>
